#ifndef GIPSYMODULE_H_
#define GIPSYMODULE_H_

#include "UARTDriverC.h"

class GipsyModule : public UARTDriverC
{
public:
	bool Initialize();
	void Update();
	void GetCoordinates(char* buffer);
	void GetFixInfo(char* buffer);
	void GetTime(char* buffer);
	double GetLatitude();
	double GetLongitude();
	float GetAltitude();
	int GetSatUsed();
	
private:
	int RXBufPosition;
	char RXBuffer[201];

	// data
	char m_time[20];
	char m_latitude[20];
	char m_longitude[20];
	double m_Lat;
	double m_Long;
	int m_fixStatus;
	int m_satUsed;
	float m_alt;
	char m_NS;
	char m_EW;

private:
	int ParseCommand(char* input);
	unsigned char CalculateChecksum(char* str, int len);
	bool CheckChecksum(char* str);
	void ExecuteCommand(char* input, int size);
};

#endif /*GIPSYMODULE_H_*/
